ccR.Add_Rotation(
	2, -- Player Specialization
	"CC_Enhancement_Solo", -- Function name
	"Developed early WoD, Not recommended.", -- Description
	"CC_Enhancement_Talents", -- Talents button frame
	"CC_Enhancement_Abilities", -- Abilities button frame
	"CC_Enhancement_Features", -- Features button frame
	"CC_Enhancement_Setup" -- Setup button frame
)
function CC_Enhancement_Solo()
	-- Lightning Shield
	if not ccR.Player.HasBuff(LIGHTNING_SHIELD) and ccR.Spell.IsReady(LIGHTNING_SHIELD) then ccR.Cast.Spell(LIGHTNING_SHIELD) end

	if ccR.Target.Exists() then	
		ccR.Start_Attack()
		if ccR.Player.IsInCombat() then
			if ccR.Target.IsBoss() then
				if ccR.Spell.IsReady(ENHANCEMENT_ASCENDANCE) and not ccR.Player.HasBuff(ENHANCEMENT_ASCENDANCE) and not ccR.Spell.IsOnCooldown(ENHANCEMENT_ASCENDANCE) then ccR.Cast.Spell(ENHANCEMENT_ASCENDANCE) end
				if ccR.Spell.IsReady(FERAL_SPIRIT) then ccR.Cast.Spell(FERAL_SPIRIT) end
				if ccR.Spell.IsReady(ANCESTRAL_SWIFTNESS) and not ccR.Player.HasBuff(ANCESTRAL_SWIFTNESS) and not ccR.Spell.IsOnCooldown(ANCESTRAL_SWIFTNESS) then ccR.Cast.Spell(ANCESTRAL_SWIFTNESS) end
				if ccR.Spell.IsReady(ELEMENTAL_MASTERY) then ccR.Cast.Spell(ELEMENTAL_MASTERY) end
				if ccR.Spell.IsReady(UNLEASH_ELEMENTS) and ccR.Player.HasTalent(UNLEASHED_FURY) then ccR.Cast.Spell(UNLEASH_ELEMENTS) end
			end
			if ccR.Player.Health() <= 85 and ccR.Player.BuffStacks(MAELSTROM_WEAPON) == 5 then ccR.Cast.Spell(HEALING_SURGE, "player") end
		end
		-- 2+ Enemies Fire Nova
		if (ccR.Player.Count(10) >= 2 or (ccR.Player.HasGlyph(GLYPH_OF_FIRE_NOVA) and ccR.Player.Count(15) >= 2)) then
			for x = 1, # ccR_Enemies_Within_16 do
				local vUnit = ccR_Enemies_Within_16[x]
				if ccR.Unit.HasMyDebuff(vUnit, FLAME_SHOCK)
				and ccR.Spell.Is.Ready(FIRE_NOVA)
				then
					if ccR.Spell.IsReady(UNLEASH_ELEMENTS) then ccR.Cast.Spell(UNLEASH_ELEMENTS) end
					ccR.Cast.Spell(FIRE_NOVA)
				end
			end
		end
		if ccR.Player.IsFacing("target") then
			-- x. Elemental Blast highest priority
			if ccR.Player.HasTalent(ELEMENTAL_BLAST) and ccR.Spell.IsReady(ELEMENTAL_BLAST) then ccR.Cast.Spell(ELEMENTAL_BLAST) end
		end
		-- 1. Searing Totem
		if ccR.Spell.IsReady(SEARING_TOTEM) and not ccR.Player.Has.Totem(FIRE_ELEMENTAL_TOTEM) and ccR.Target.Distance() <= 25 and (not ccR.Player.HasTotem(SEARING_TOTEM) or ccR.Player.TotemDistance(SEARING_TOTEM, "target") >= 26) then ccR.Cast.Spell(SEARING_TOTEM) end
		if ccR.Player.IsFacing("target") then
			if ccR.Target.Count(16) >= 3 then
				-- 3. Chain Lightning at 5x Maelstrom Weapon
				if ccR.Spell.CanAttack(CHAIN_LIGHTNING) and (ccR.Player.BuffStacks(MAELSTROM_WEAPON) == 5 or ccR.Player.HasBuff(ANCESTRAL_SWIFTNESS)) then ccR.Cast.Attack(CHAIN_LIGHTNING) end
			else
				-- 3. Lightning Bolt at 5x Maelstrom Weapon
				if ccR.Spell.CanAttack(LIGHTNING_BOLT) and (ccR.Player.BuffStacks(MAELSTROM_WEAPON) == 5 or ccR.Player.HasBuff(ANCESTRAL_SWIFTNESS)) then ccR.Cast.Attack(LIGHTNING_BOLT) end
			end
			-- 4. Stormstrike, Windstrike during Ascendance
			if ccR.Spell.CanAttack(STORMSTRIKE) and not ccR.Player.HasBuff(ENHANCEMENT_ASCENDANCE) then ccR.Cast.Attack(STORMSTRIKE) end
			if ccR.Spell.CanAttack(WINDSTRIKE) and ccR.Player.HasBuff(ENHANCEMENT_ASCENDANCE) then ccR.Cast.Attack(WINDSTRIKE) end
			-- 5. Lava Lash
			if ccR.Spell.CanAttack(LAVA_LASH) then ccR.Cast.Attack(LAVA_LASH) end
			-- 6. Apply Flame Shock
			if ccR.Spell.CanAttack(FLAME_SHOCK) and ((ccR.Target.HasMyDebuff(FLAME_SHOCK) and ccR.Target.DebuffDuration(FLAME_SHOCK) <= 9 and ccR.Player.HasBuff(ENHANCEMENT_UNLEASH_FLAME)) or not ccR.Target.HasMyDebuff(FLAME_SHOCK)) then ccR.Cast.Attack(FLAME_SHOCK) end
			-- 7. Cast Unleash Elements
			if ccR.Spell.IsReady(UNLEASH_ELEMENTS) and ccR.Player.IsInCombat() then ccR.Cast.Spell(UNLEASH_ELEMENTS) end
			-- 8. Frost Shock
			if ccR.Spell.CanAttack(FROST_SHOCK) then ccR.Cast.Attack(FROST_SHOCK) end
			-- 9. Lightning Bolt with 1 or more stacks of Maelstrom Weapon
			--[[if ccR.Player.Count(16) >= 3 then
				-- 3. Chain Lightning at 1+ Maelstrom Weapon
				if ccR.Spell.CanAttack(CHAIN_LIGHTNING) and (ccR.Player.BuffStacks(MAELSTROM_WEAPON) >= 1 or ccR.Player.HasBuff(ANCESTRAL_SWIFTNESS)) then ccR.CastAttack(CHAIN_LIGHTNING) end
			else
				if ccR.Spell.CanAttack(LIGHTNING_BOLT) and (ccR.Player.BuffStacks(MAELSTROM_WEAPON) >= 1 or ccR.Player.HasBuff(ANCESTRAL_SWIFTNESS)) then ccR.CastAttack(LIGHTNING_BOLT) end
			end]]
		end
		-- 10. Refresh Searing Totem if less than 20 seconds left
		if ccR.Player.HasTotem(SEARING_TOTEM) and not ccR.Player.Has.Totem(FIRE_ELEMENTAL_TOTEM) and ccR.Player.TotemDuration(1) <= 20 and ccR.Spell.Is.Ready(SEARING_TOTEM) then ccR.Cast.Spell(SEARING_TOTEM) end
	end
end